﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="GridView的综合使用._Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title>无标题页</title>
        <style type="text/css">
        	.gridStudent
        	{
        		line-height: 30px;
        	}
        </style>
    </head>
    <body style="background-color: lightblue">
        <form id="form1" runat="server">
            <div style="width: 700px; margin: auto; border: solid 2px">
                <div style="text-align: center"><div>学生信息列表</div>
                    <div><asp:GridView ID="gridStudent" runat="server" Width="100%"  
                                       AutoGenerateColumns="False" AllowPaging="True" 
                                       onpageindexchanging="gridStudent_PageIndexChanging"  >
                             <Columns>
                                 <asp:BoundField HeaderText="序号" />
                                 <asp:BoundField DataField="StudentID" HeaderText="学号" />
                                 <asp:HyperLinkField HeaderText="姓名" DataTextField="Name" 
                                                     DataNavigateUrlFields="StudentID" 
                                                     DataNavigateUrlFormatString="StudentDetails.aspx?id={0}"/>
                                 <asp:BoundField DataField="DepartmentName" HeaderText="系"  />
                                 <asp:ImageField HeaderText="照片" DataImageUrlField="Photo" 
                                                 DataImageUrlFormatString="images/{0}">
                                     <ControlStyle Height="50px" />
                                 </asp:ImageField>
               
                                                                           
               
                             </Columns>
                         </asp:GridView></div><div><a href="AddStudent.aspx">添加学生</a></div></div>
            </div>
        </form>
    </body>
</html>